package com.example.shopping_web_back.config;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class GlobalOptionsHandler {

    @RequestMapping(value = "/**", method = RequestMethod.OPTIONS)
    @ResponseBody
    public ResponseEntity<Void> handleOptions() {
        return ResponseEntity.ok().build();
    }
}
